/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package gr.anagnosg.general.utils;

import java.util.Date;

/**
 *
 * @author anagnosg
 */
public class Monitor {
 long start=0;
 long end=0;
 long diff=0;
 
    public long getStart() {
        return start;
    }

    public void setStart(long start) {
        this.start = start;
    }

    public long getEnd() {
        return end;
    }

    public void setEnd(long end) {
        this.end = end;
    }

    public long getDiff() {
        return diff;
    }

    public void setDiff(long diff) {
        this.diff = diff;
    }

    
    public void tic(){
        this.start=new Date().getTime();
    }
    
    public long toc(){
        this.end= new Date().getTime();
        this.diff = this.end - this.start;
        return this.diff;
    }
    
    public void print(String message){
        System.out.println(message  + " diff:"+this.diff);
    }
 
}
